#!/bin/sh

netif_create() {
	# TUN/TAP module need loaded before creation
	modprobe -q tun

    if [ -n "$user" ]; then
        ip tuntap add dev $interface mode tap user $user
    elif [ -n "$group" ]; then
        ip tuntap add dev $interface mode tap group $group
    else
        ip tuntap add dev $interface mode tap
    fi
}

netif_destroy() {
    ip tuntap del dev $interface mode tap
}

netif_pre_up() {
    ip link set $interface promisc on
}
